package com.zqh.orderitemquery.controller;

import com.zqh.myfmmall.entity.OrderItem;
import com.zqh.myfmmall.result.Result;
import com.zqh.orderitemquery.service.OrderItemQueryService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-02-18 2:15
 */
@RestController
@RequestMapping("orderItem")
public class OrderItemQueryController{
    @Resource
    private OrderItemQueryService orderItemQueryService;

    @GetMapping("listByOrderId/{orderId}")
    public Result listByOrderId(@PathVariable("orderId") String orderId){
        return orderItemQueryService.getByOrderId(orderId);
    }

    @GetMapping("retrieve/{id}")
    public Result retrieve(@PathVariable("id") String id){
        OrderItem orderItem = orderItemQueryService.getById(id);
        return Result.success(orderItem);
    }
}
